package com.xc.quickstart.api.vo;

import com.xc.quickstart.mapper.entity.CrmAdminENT;
import com.xc.quickstart.service.dto.DeptInfoDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(description = "CRM部门信息")
public class DeptInfoVO {

    @ApiModelProperty(value = "ID")
    Integer id;

    @ApiModelProperty(value = "值")
    String value;

    @ApiModelProperty(value = "部门ID")
    Integer deptId;

    @ApiModelProperty(value = "用户ID")
    Integer userId;

    @ApiModelProperty(value = "工号")
    String jobNumber;

    @ApiModelProperty(value = "是否有下级部门")
    Boolean nextDept;

    @ApiModelProperty(value = "下级部门数量")
    Integer childDeptNum;


    public DeptInfoVO(DeptInfoDTO deptInfoDto){
        this.deptId = deptInfoDto.getDdDeptId();
        this.value  = deptInfoDto.getDeptName();
    }

    public DeptInfoVO(CrmAdminENT crmAdminENT){
        this.deptId = crmAdminENT.getDeptId();
        this.userId = crmAdminENT.getUserId();
        this.value  = crmAdminENT.getUserName();
        this.jobNumber = crmAdminENT.getJobNumber();
    }

    public DeptInfoVO(Integer deptId, String deptName){
        this.id = deptId;
        this.value = deptName;
    }
}
